libxenlight: initialize domid to -1 in domain_create
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 8 Jan 2010 11:48:36 +0000 (11:48 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 8 Jan 2010 11:48:36 +0000 (11:48 +0000)
prevent call site that doesn't check return values to try to do
operation on domain 0.
instead they use domid -1, which is unlikely to exist.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/libxl/libxl.c

index 46dcebf76aa87e7aa2890e550c0ddaea688624e5..c2dcbcc52d484cff3113ca331494450567ec781b 100644 (file)
@@ -99,7 +99,7 @@ int libxl_domain_make(struct libxl_ctx *ctx, libxl_domain_create_info *info,
 
     flags = info->hvm ? XEN_DOMCTL_CDF_hvm_guest : 0;
     flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0;
-    *domid = 0;
+    *domid = -1;
 
     /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
     memcpy(handle, info->uuid, sizeof(xen_domain_handle_t));